package com.hxiaoyi.cloud.service;

import com.hxiaoyi.cloud.entities.CommonResult;
import com.hxiaoyi.cloud.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * FeignClient功能组件接口
 * @author 黄敬意
 * @date 2022-02-06 14:48
 **/
@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {
    /**
     * FeignClient接口
     * @param id
     * @return CommonResult
     */
    @GetMapping(value = "/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

    /**
     * 验证feign超时,feign默认是等待1秒钟
     * @author 黄敬意
     * @date 2022/2/6 15:17
     * @return String
     **/
    @GetMapping(value = "/payment/feign/timeout")
    public String paymentFeignTimeout();
}
